import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import DynamicForm from '../components/DynamicForm.vue'
import TemplateList from '@/views/TemplateList.vue'
import AddCollDataVue from '@/components/AddCollData.vue'
import CollectionList from '@/components/CollectionList.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // {
    //   path: '/',
    //   name: 'home',
    //   component: HomeView
    // },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/add_form_template',
      name: 'addformtemplate',
      component: DynamicForm
    },
    {
      path: '/list_form_template',
      name: 'templatelist',
      component: TemplateList,
    }, {
      path: '/add_collection',
      name: 'addcollection',
      component: TemplateList,
    },
    {
      path: '/add_coll_data',
      name: 'addcolldata',
      component: AddCollDataVue
    },
    {
      path: "/coll_list",
      name: 'colllist',
      component: CollectionList
    }
  ]
})

export default router
